package com.earthea.scaffold.common.enums;

import cn.hutool.http.HttpStatus;
import com.earthea.common.exception.IErrorCode;
import lombok.Getter;

/**
 * 公共错误码
 */
@Getter
public enum HttpCodeEnum implements IErrorCode {
    /**
     * 200成功
     */
    SUCCESS(HttpStatus.HTTP_OK, "Success"),
    /**
     * 500系统未知错误
     */
    FAIL(HttpStatus.HTTP_INTERNAL_ERROR, "Fail"),
    /**
     * 400没权限
     */
    HTTP_BAD_REQUEST(HttpStatus.HTTP_BAD_REQUEST, "Bad Request"),
    /**
     * 401没权限
     */
    HTTP_UNAUTHORIZED(HttpStatus.HTTP_UNAUTHORIZED, "Invalid Token"),
    ;

    private final int code;

    private final String msg;

    HttpCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
